
import Taro from '@tarojs/taro';
import { View, Text, Image } from "@tarojs/components";
import PropTypes from 'prop-types';
import './index.scss'

class UseRecordItem extends Taro.Component {
    static defaultProps = {
        RecordItem: {},
        itemTap: () => { }
    };
    constructor(props) {
        super(props);
        this.state = {}
    }
    render() {
        let { itemTap, RecordItem } = this.props;
        return (
            <View onClick={(e) => { itemTap(e, RecordItem) }} className='use-record-item  pl-3-5 pt-3-5 pr-4  ft26 bg_fff vo_h mb-2-5 bdr_10 mt-2-5 ov_h'>
                <View className=''>
                    <View className='fc_53C mb-2 flex flex-r flex-item-between ft_w600'>
                        <Text className='ft32'>药品名：{RecordItem.drugname}</Text>
                        <Image className='ml-0-5' style={{ width: Taro.pxTransform(12), height: Taro.pxTransform(22), opacity: 0.6 }} src={require('../../assets/imgs/home/home_icon_pressed.png')} />
                    </View>
                    <View className='mb-2'> 批号：{RecordItem.batch}</View>
                    <View className='fc_FF8 pb-3 line-b'>消耗状态：使用</View>
                    {/* 今天 09:15 */}
                    <View className='pt-3 mb-2-5 fc_B9C' >{RecordItem.timesString}</View>
                </View>
            </View>
        );
    }
}

export default UseRecordItem;

UseRecordItem.propTypes = {
    RecordItem: PropTypes.object,
    itemTap: PropTypes.func
}